/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package net.tygzs.minerpg.CommandExecutor.MineTeam;

import net.md_5.bungee.api.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;

/**
 *
 * @author thtTNT
 */
public class MineTeam implements CommandExecutor
{
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String args[])
    {
        if (args.length == 0)
        {
            Executor.sendHelp(sender);
            return true;
        }
        if (args[0].equalsIgnoreCase("exit"))
        {
            Executor.leave(sender);
            return true;
        }
        if (args[0].equalsIgnoreCase("info"))
        {
            Executor.sendInfo(sender);
            return true;
        }
        if (args[0].equalsIgnoreCase("exit"))
        {
            Executor.sendInfo(sender);
            return true;
        }
        if (args[0].equalsIgnoreCase("join"))
        {
            if (args.length == 2)
            {
                Executor.join(sender, args[1]);
                return true;
            }
            sender.sendMessage(ChatColor.YELLOW + "/MineTeam join [队伍名称] 加入指定的队伍");
            return true;
        }
        return true;
    }
}
